package com.sise.parkinglot.controller.applet;

import com.sise.parkinglot.bean.CodeMsg;
import com.sise.parkinglot.entity.Park;
import com.sise.parkinglot.entity.SitInfo;
import com.sise.parkinglot.service.ISitInfoService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * @author ZJ
 */
@RestController
@RequestMapping("/api/sit-info")
public class AppletSitInfoController {

    @Resource
    private ISitInfoService sitInfoService;

    @PostMapping("/getParkingLot")
    public CodeMsg<SitInfo> getParkingLot(@RequestBody Map<String, String> map){
        return sitInfoService.getParkingLot(map);
    }

    @PostMapping("/isParkingLot")
    public CodeMsg<SitInfo> isParkingLot(@RequestBody Map<String, String> map){
        return sitInfoService.isParkingLot(map);
    }

    @PostMapping("/endParkingLot")
    public CodeMsg<Park> endParkingLot(@RequestBody Map<String, String> map){
        return sitInfoService.endParkingLot(map);
    }
}
